import { INJECT_GROUP_CLASS_NAME_MAP } from '@/const/'


const GROUP_PLACEHOLDER = {
  ClickGetCard: {
    name: "领取卡片",
    placeholder: "无",
    site: 1383,
  },
  OpenDoor: {
    name: "开门动画",
    placeholder: "gsap:{ leftCompId:{toLeft,duration,pageId,ease}, rightCompId:{toRight,duration,ease} }",
    site: 1471,
  },
  ClickSpeedPK: {
    name: "进度条PK动画",
    placeholder: "{time,count,triggerRelateCompId,successPopId,failPopId,notEnough}",
    site: 1572,
  },
  ImgBounceAnim: {
    name: "图片跳动动画",
    placeholder: "{ gsap:{y,yoyo,ease,duration,repeat} }",
    site: 1572,
  },
  ClickChangeText: {
    name: "点击文本键盘",
    placeholder: "无",
    site: 1535,
  },
  GetChangeText: {
    name: "获取点击文本键盘文字",
    placeholder: "无",
    site: 1535,
  },
  MenuByImgs: {
    name: "图片组菜单",
    placeholder: "无",
    site: "1822&pageId=5",
  },
  GroupRadios: {
    name: "单选组",
    placeholder: "{selectedCompId,offsetX,offsetY }",
    site: 1471,
  },
  MenuByBtns: {
    name: "按钮组菜单",
    placeholder: "{need,relateIds,isDefaultSelectedItemIndex,defaultSelectedItemIndex,isRecord,constNum,selectedCompId,offsetX,offsetY }",
    site: "2067/1992",
  },
  ClickPlaySpriteSheetAnim: {
    name: "雪碧图动画",
    placeholder: "{ selectedCompId,offsetX,offsetY }",
    site: 1566,
  },
  CompVisibility: {
    name: "组件可见",
    placeholder: "{'type':'visible'}",
    site: 1039,
  },
  DragInSvg: {
    name: "根据svg图形画路径",
    placeholder: "{'isVisibles':[0]}",
    site: 1723,
  },
  DragInImg: {
    name: "根据img图形画路径",
    placeholder: "{delayTime,relateEventCompId,clipCompId}",
    site: 2186,
  },
  AppearInSequenceAnim: {
    name: "顺序出现",
    placeholder:
      "{compId:{type,delayTime,duraion,displayCompId},gsap:{ delayTime }}",
    site: 1778,
  },
  GradeChange: {
    name: "根据等级显示图片",
    placeholder: "无",
    site: 0,
  },
  ClickSignDay: {
    name: "签到",
    placeholder: "无",
    site: 1911,
  },
  ClickGetNumberAnim: {
    name: "数字滚动抽奖",
    placeholder: "无",
    site: 0,
  },
  LotteryTurnTable: {
    name: "转盘抽奖",
    placeholder: "无",
    site: 0,
  },
  ClickPuzzle: {
    name: "拼图和配对抽奖",
    placeholder: "{relateCompId,urls}",
    site: "1822&pageId=4",
  },
  TwistedEgg: {
    name: "扭蛋机2",
    placeholder: "{bgCompId,pathNum,gsap:{isBezier,time,repeat,duration,ease}",
    site: 2276,
  },
  TwistedEggMatter: {
    name: "扭蛋机",
    placeholder: "{matter:{width,height,ballWidth,ballHeight,ratio,gravityY,imgs:[]}}",
    site: 2281,
  },
  RadioImg: {
    name: "单选背景动画",
    placeholder: "{radioCompId,letter-spacing}",
    site: 2282,
  },
  Barrage: {
    name: "弹幕",
    placeholder:
      "{content:[],textSize,imgHeight,fontColor,duration,numgsap:{}}",
    site: 2314,
  },
  Plant: {
    name: "元气植物",
    placeholder: "{total,rules:[],pushId}",
    site: 2422,
  },
  ClickScrollerImages: {
    name: "滚动图片",
    placeholder: "无",
    site: 0,
  },
  ClickRedBagRain: {
    name: "红包雨",
    placeholder: "{gsap:{imgWidth,duration,imgCount,ease }}",
    site: 2168,
  },
  ParticleCartoon: {
    name: "粒子动画",
    placeholder: "{particle:width,count,all,jsonUrl}}",
    site: "1273&pageId=8",
  },
  Checkbox: {
    name: "按钮多选",
    placeholder: "{indexType,need,max,min,emitCompId,listCompId,msg}",
    site: "2129&pageId=13",
  },
  DragInRect: {
    name: "根据矩形svg绘制路径",
    placeholder: "{isVisibles,progressEmit,wIndexs}",
    site: "2487",
  },
  RandomSelected:{
    name: "随机选中",
    placeholder: "{checkNum,listCompId}",
    site: "2591&pageId=2",
  },
  SvgFlashStarBg:{
    name: "星星闪烁背景",
    placeholder: "{svg,backgroundColor,fillColor,twinkleColor}",
    site: 0,
  },
  SvgRandomCircleBg:{
    name: "随机圆背景",
    placeholder: "{svg,backgroundColor,strokeWidth,opacity,radius,minRadius}",
    site: "2588&pageId=2",
  }
}

const getPlaceholder = (className: string) => {
  let placeholder: any
  switch(className) {
    case INJECT_GROUP_CLASS_NAME_MAP.CheckBox:
      placeholder = GROUP_PLACEHOLDER.Checkbox
    break
    case INJECT_GROUP_CLASS_NAME_MAP.ClickGetCard:
      placeholder = GROUP_PLACEHOLDER.ClickGetCard
    break
    case INJECT_GROUP_CLASS_NAME_MAP.OpenDoor:
      placeholder = GROUP_PLACEHOLDER.OpenDoor
    break
    case INJECT_GROUP_CLASS_NAME_MAP.ClickSpeedPK:
      placeholder = GROUP_PLACEHOLDER.ClickSpeedPK
    break
    case INJECT_GROUP_CLASS_NAME_MAP.ClickChangeText:
      placeholder = GROUP_PLACEHOLDER.ClickChangeText
    break
    case INJECT_GROUP_CLASS_NAME_MAP.GetChangeText:
      placeholder = GROUP_PLACEHOLDER.GetChangeText
    break
    case INJECT_GROUP_CLASS_NAME_MAP.MenuByImgs:
      placeholder = GROUP_PLACEHOLDER.MenuByImgs
    break
    case INJECT_GROUP_CLASS_NAME_MAP.GroupRadios:
      placeholder = GROUP_PLACEHOLDER.GroupRadios
    break
    case INJECT_GROUP_CLASS_NAME_MAP.MenuByBtns:
      placeholder = GROUP_PLACEHOLDER.MenuByBtns
    break
    case INJECT_GROUP_CLASS_NAME_MAP.ClickPlaySpriteSheetAnim:
      placeholder = GROUP_PLACEHOLDER.ClickPlaySpriteSheetAnim
    break
    case INJECT_GROUP_CLASS_NAME_MAP.ImgBounceAnim:
      placeholder = GROUP_PLACEHOLDER.ImgBounceAnim
    break
    case INJECT_GROUP_CLASS_NAME_MAP.CompVisibility:
      placeholder = GROUP_PLACEHOLDER.CompVisibility
    break
    case INJECT_GROUP_CLASS_NAME_MAP.DragInSvg:
      placeholder = GROUP_PLACEHOLDER.DragInSvg
    break
    case INJECT_GROUP_CLASS_NAME_MAP.DragInImg:
      placeholder = GROUP_PLACEHOLDER.DragInImg
    break
    case INJECT_GROUP_CLASS_NAME_MAP.DragInRect:
      placeholder = GROUP_PLACEHOLDER.DragInRect
    break
    case INJECT_GROUP_CLASS_NAME_MAP.AppearInSequenceAnim:
      placeholder = GROUP_PLACEHOLDER.AppearInSequenceAnim
    break
    case INJECT_GROUP_CLASS_NAME_MAP.ClickSignDay:
      placeholder = GROUP_PLACEHOLDER.ClickSignDay
    break
    case INJECT_GROUP_CLASS_NAME_MAP.ClickRedBagRain:
      placeholder = GROUP_PLACEHOLDER.ClickRedBagRain
    break
    case INJECT_GROUP_CLASS_NAME_MAP.ParticleCartoon:
      placeholder = GROUP_PLACEHOLDER.ParticleCartoon
    break
    case INJECT_GROUP_CLASS_NAME_MAP.TwistedEggMatter:
      placeholder = GROUP_PLACEHOLDER.TwistedEggMatter
    break
    case INJECT_GROUP_CLASS_NAME_MAP.TwistedEgg:
      placeholder = GROUP_PLACEHOLDER.TwistedEgg
    break
    case INJECT_GROUP_CLASS_NAME_MAP.RadioImg:
      placeholder = GROUP_PLACEHOLDER.RadioImg
    break
    case INJECT_GROUP_CLASS_NAME_MAP.Barrage:
      placeholder = GROUP_PLACEHOLDER.Barrage
    break
    case INJECT_GROUP_CLASS_NAME_MAP.Plant:
      placeholder = GROUP_PLACEHOLDER.Plant
    break
    case INJECT_GROUP_CLASS_NAME_MAP.ClickScrollerImages:
      placeholder = GROUP_PLACEHOLDER.ClickScrollerImages
    break
    case INJECT_GROUP_CLASS_NAME_MAP.SvgFlashStarBg:
      placeholder = GROUP_PLACEHOLDER.SvgFlashStarBg
    break
    case INJECT_GROUP_CLASS_NAME_MAP.SvgRandomCircleBg:
      placeholder = GROUP_PLACEHOLDER.SvgRandomCircleBg
    break
    case INJECT_GROUP_CLASS_NAME_MAP.RandomSelected:
      placeholder = GROUP_PLACEHOLDER.RandomSelected
    break
  }
  if(placeholder) {
    return JSON.stringify(placeholder.placeholder)
  } else {
    return ''
  }
}

export {
  getPlaceholder
}